//
//  MBDRejectReasonCellModel.swift
//  MasterBoy
//
//  Created by kyson on 2024/4/9.
//

import Foundation

import YYText


class MBDRejectReasonCellModel : MBDCommonCellModel {
    
    var reasonLayout : YYTextLayout!
    var cellHeight : CGFloat!

    var reason : String! {
        didSet {
            let titleAttributeString = NSMutableAttributedString(string: "拒绝理由：" + reason )
            titleAttributeString.yy_font = UIFont.systemFont(ofSize: 14)
            titleAttributeString.yy_color = UIColor.white
            titleAttributeString.yy_lineSpacing = 6

            let userNamecontainer = YYTextContainer()
            let userNameWidth = CGRectGetWidth(UIScreen.main.bounds) - 30
            userNamecontainer.size = CGSizeMake(userNameWidth , CGFLOAT_MAX)
            userNamecontainer.maximumNumberOfRows = 0

            let titleLayout = YYTextLayout(container: userNamecontainer, text: titleAttributeString)
            self.reasonLayout = titleLayout
            
            self.cellHeight = 5 + titleLayout!.textBoundingSize.height + 5
        }
    }
    
//    override func cellHeight() -> CGFloat {
//        return 25
//    }
    
}
